package votd_notification;

import database.helpers.VOTD_Table;
import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.media.ThumbnailUtils;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
import androidhive.dashboard.R;

public class VOTD extends Activity {
	/** Called when the activity is first created. */
	VOTD_Table votdTab;
	private String refScrip="nothing";
	private String scripture="nothing";
	public static  String INTENT_REF= "smethng.INTENT_NOTIFY";
	public static  String INTENT_MSG = "PARAM";
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.photos_layout);
//		Intent intent= getIntent();
//		refScrip= intent.getStringExtra(VOTD.INTENT_REF);
//		scripture= intent.getStringExtra(VOTD.INTENT_MSG);
		
		
		getVOTD();
//		votdTab = new VOTD_Table(this);
//		getVOTD();

	}

	private void getVOTD() {
		// TODO Auto-generated method stub
		votdTab= new VOTD_Table(this);
		Cursor c = votdTab.getAllVOTDs();
		String today;
		String refSCr = "nothing";
		String scripture = "nothing";
		if (!c.equals(null))
			c.moveToFirst();
	while (c.isAfterLast() == false ) 
	{
		today = c.getString(1);
			if (today.equals("today"))
			{
			refSCr = c.getString(2);
			scripture = c.getString(3);
			votdTab.UpdateOpened(today, c.getString(0));
			TextView vo= (TextView) findViewById(R.id.btn_faq);
			vo.setText(scripture);
			Toast.makeText(VOTD.this, scripture, Toast.LENGTH_LONG).show();
			return;
			}
			c.moveToNext();
		}
		
	}
}
